home *** CD-ROM | disk | FTP | other *** search
/ Sport Stretch Interactive Stretching / Sport Stretch Interactive Stretching.iso / pc / PGFINISH.DIR / 00046_QuickTime Control Slider.ls < prev    next >
Encoding:
Text File  |  2000-08-24  |  1.6 KB  |  52 lines

  1. property pSprite, pDuration, pSliderSprite
  2.  
  3. on getBehaviorDescription
  4.   return "QuickTime Control Slider" & RETURN & RETURN & "Use this behavior in conjunction with the Animation: Interactive 'Constrain to Line' behavior to create a slider control for QuickTime digital videos. " & "Attach the 'Constrain' behavior to the slider and set its parameters and put this behavior on the digital video sprite." & RETURN & RETURN & "PARAMETERS:" & RETURN & " - channel number of Slider sprite." & RETURN & RETURN & "PERMITTED TYPES:" & RETURN & "#QuickTimeMedia"
  5. end
  6.  
  7. on getBehaviorTooltip me
  8.   return "Use in conjunction with the Constrain to Line behavior (in the Animation > Interactive library) to create a slider that can respond to QuickTime playback."
  9. end
  10.  
  11. on beginSprite me
  12.   mInitialize(me)
  13. end
  14.  
  15. on prepareFrame me
  16.   mUpdate(me)
  17. end
  18.  
  19. on mInitialize me
  20.   pSprite = sprite(me.spriteNum)
  21.   pDuration = pSprite.duration
  22. end
  23.  
  24. on mUpdate
  25.   vValue = float(pSprite.movieTime) / pDuration
  26.   sendSprite(pSliderSprite, #mSetConstrainPos, vValue, 0)
  27. end
  28.  
  29. on mConstrainedValue me, vSlider, vValue
  30.   if vSlider = pSliderSprite then
  31.     pSprite.movieTime = integer(pDuration * vValue)
  32.   end if
  33. end
  34.  
  35. on isOKToAttach me, aSpriteType, aSpriteNum
  36.   case aSpriteType of
  37.     #graphic:
  38.       return getPos([#quickTimeMedia], sprite(aSpriteNum).member.type) <> 0
  39.     #script:
  40.       return 0
  41.   end case
  42. end
  43.  
  44. on getPropertyDescriptionList me
  45.   if not (the currentSpriteNum) then
  46.     exit
  47.   end if
  48.   vPDList = [:]
  49.   setaProp(vPDList, #pSliderSprite, [#comment: "Slider Sprite", #format: #integer, #default: the currentSpriteNum + 1, #range: [#min: 1, #max: the lastChannel]])
  50.   return vPDList
  51. end
  52.